from flask import Blueprint, request
import warnings
from main import *
warnings.filterwarnings("ignore")
import json
import sys
import os
from main import *

# 创建蓝图
XpScore = Blueprint('XpScore', __name__, url_prefix='/')


@XpScore.route('/model/evaluate', methods=['GET', 'POST'])
def green_model():
    data = request.get_data().decode('utf-8')
    print(data)
    dic = json.loads(data)
    lst = dic['pjuuid']
    print(lst)
    df = green_model_score(lst)
    js = df.to_json(orient='records')
    return js